/*
 * @Author: wuxiangyi
 * @Date: 2022-04-02 19:26:22
 * @LastEditors: wuxiangyi
 * @LastEditTime: 2022-04-02 19:30:33
 * @FilePath: /SmartlabMiddlewareWeb/src/pages/OfflineMapP/index.jsx
 * @Description: 
 * 
 */
import React, { Component } from 'react'
import $ from 'jquery';
import L from 'leaflet';
import 'leaflet/dist/leaflet.css'
import mapIcon from '../../assets/location-2.png'
import mapIconBlue from '../../assets/location.png'
import { connect } from 'react-redux'

export default class index extends Component {
    state = {
        // 默认中⼼点
        defaultCenter: {
            lag: 30.36604845820141,
            lng: 112.08174705505373
        }
    }

    componentDidMount() {
        this._map = null;
        this.glayer_normal = null;
        this.glayer_satelite = null;
        var url_normal = '/api/server/web/rest/offlineMap/788865972/{z}/{x}/{y}';
        this.glayer_normal = new L.TileLayer(url_normal, { minZoom: 10, maxZoom: 18, attribution: '普通地图' });
        // 设置地图高度
        $(window).height(function () {
            $("#mainmap").css("height", '55vh');
        });
        $("#mainmap").empty();
        this._map = new L.Map('mainmap', { layers: [this.glayer_normal] });
        this.init();
    }

    // 地图组件初始化
    init = () => {
        
    }

    render() {
        return (
            <div id="mainmap" className="logo" onClick={this.doMark} />
        )
    }
}
